{% extends 'base.html' %}
{% block content %}
{% load static %}

<div style="width:1080px;margin:auto;">
<form method="post">
    {% csrf_token %}
    <h1 class="mt-3" align="center">{{scan_info.ip_address}}{{info}}端口扫描</h1>
        <table class="table table-bordered">
            <tr class="table-primary">
<!--                <th width="10%">ID</th>-->
                <th width="30%">目标设备IP</th>
                <th>端口</th>
                <th>端口状态</th>
            </tr>
            {% for a in result %}
            <tr class="table-info">
                <th>{{a.0}}</th>
                <th>{{a.1}}</th>
                <th>{{a.2}}</th>
            </tr>
            {% endfor %}
        </table>
    <div class="pick" style="margin:auto;">
        <input type="hidden" name="ip" value="{{info}}">
        <button type="submit" class="btn btn-primary" style="width:120px;margin-left:35%">重新扫描</button>
        <a type="submit" class="btn btn-primary" href="http://127.0.0.1:8000/scan" style="width:120px;margin-left:5%">返回</a>
    </div>
</form>
</div>
<script type="text/javascript">
document.body.innerHTML = document.body.innerHTML.replace(/未开启/ig,"<span style='color: red;'>$&</span>");
</script>

{% endblock %}

